package com.flash.javamate;

import com.flash.javamate.entity.ApiDocEnvironment;
import com.flash.javamate.handler.impl.ControllerDataModelHandler;
import com.flash.javamate.utils.HtmlOutput;
import com.flash.javamate.utils.JavaPathHandler;

import java.io.File;
import java.io.FileNotFoundException;

/**
 * @author sunyiming
 * @date 2018/8/13
 */
public class ApiDocDemo2 {

    public static void main(String[] args) {
        //String userDir = "E:\\projects\\iqiyiProjects\\moviebar-pay\\src\\main\\java\\";
        String userDir = "E:\\projects\\iqiyiProjects\\moviebar-pay\\src\\main\\java\\";
        String[] userDirs = {
                "E:\\projects\\iqiyiProjects\\moviebar-cloud-api\\moviebar-cloud\\src\\main\\java\\",
                "E:\\projects\\iqiyiProjects\\moviebar-cloud-api\\moviebar-core\\src\\main\\java\\"
        };
        String classFullName = "com.iqiyi.moviebar.pay.controller.MerchantRegisterController";
        //String classFullName = "com.iqiyi.moviebar.cloud.controller.businesscontroller.OrderPlayStatisticController";
        String realPath = JavaPathHandler.getRealPath(userDir,classFullName);
        File javaFile = JavaPathHandler.getFile(userDir, classFullName, userDirs);
        File out = new File("apiout.html");
//厉不厉害哦再看一眼sb 哼 页面也是自己做的？废话 、、、你看我的
        ApiDocEnvironment env = new ApiDocEnvironment();
        env.setDevHost("http://10.3.23.234:9001");
        env.setTestHost("http://test");
        env.setProdHost("http://prod");
        env.setUserDir(userDir);
        env.setUserDirs(userDirs);

        HtmlOutput.generateApiDoc(javaFile, out, new ControllerDataModelHandler(env));
    }


}
